package io.renren.modules.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.user.dto.UserDto;
import io.renren.modules.user.entity.User;
import io.renren.modules.user.mapper.UserMapper;
import io.renren.modules.user.service.UserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UserServiceImpl extends CrudServiceImpl<UserMapper, User, UserDto> implements UserService {

    @Override
    public QueryWrapper<User> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


}